<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <h1></h1>
  <script>

    // function f1(x, y = 0) {
    //   return x + y;
    // }

    // let res = f1(5)
    // console.log(res);


    let h1 = document.querySelector("h1");


    function formatDate(day) {
      let targetTime = new Date().getTime() + 60 * 60 * 24 * 1000 * day;
      let date = new Date(targetTime);
      console.log(`${date.getFullYear()}年${date.getMonth()}月${date.getDate()}日.${date.getHours()}:${date.getMinutes()}:${date.getSeconds()}`);
    }
    formatDate(5);

    let second = setInterval(() => {
      let date = new Date();
      h1.innerText = `${date.getFullYear()}年${date.getMonth()}月${date.getDate()}日.${date.getHours()}:${date.getMinutes()}:${date.getSeconds()}`
    }, 1000)







  </script>
</body>

</html>